# Maintainer: Konstantin Gizdov <arch at kge dot pw>
pkgname=perl-locale-codes
pkgver=3.72
pkgrel=1
pkgdesc='Distribution of modules to handle locale codes'
_dist=Locale-Codes
arch=('any')
url="https://metacpan.org/release/${_dist}"
license=('GPL' 'PerlArtistic')
depends=(perl)
checkdepends=('perl-test-inter')
options=('!emptydirs' purge)
source=("http://search.cpan.org/CPAN/authors/id/SBECK/${_dist}-${pkgver}.tar.gz")
sha256sums=('5859c087d6f977ee237bc762396adb352b9732d325ccbd2cecacdad63e2f1320')

build() {
  cd "${srcdir}/${_dist}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  /usr/bin/perl Makefile.PL
  make
}

check() {
  cd "${srcdir}/${_dist}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd "${srcdir}/${_dist}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  make install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
}
